Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Nov 16, 2025

This PR attempts to address Issue #9298. Feedback and guidance are welcome.

Problem

File paths containing or ending with "str" were being corrupted when using file tools (WriteToFileTool and GenerateImageTool). For example, a path like /root/oxyde_strat/stratoxyde-v2/src/services/storage/saveStates.ts would be incorrectly processed, creating a file named "str" in the working directory.

Root Cause

The removeClosingTag function was being incorrectly called in the execute methods of these tools. This function is meant for cleaning up partial XML tags during streaming (in handlePartial methods), but was being misused on actual file paths.

Solution

  • Removed incorrect removeClosingTag calls from execute methods in WriteToFileTool and GenerateImageTool
  • These tools now use file paths directly without modification
  • removeClosingTag remains available for its intended purpose in handlePartial methods

Changes

  • Fixed WriteToFileTool.ts to use paths directly
  • Fixed GenerateImageTool.ts to use paths directly
  • Added comprehensive tests to verify paths with "str" are handled correctly

Testing

  • Added new test suite specifically for this issue
  • All existing tests continue to pass
  • Verified paths with "str" at the end or in the middle work correctly

Important

Fixes file path corruption in WriteToFileTool and GenerateImageTool by removing incorrect removeClosingTag calls and adds tests for verification.

  • Behavior:
    • Removed removeClosingTag calls from execute methods in WriteToFileTool and GenerateImageTool to prevent file path corruption.
    • Paths with "str" are now handled correctly without modification.
  • Testing:
    • Added pathCorruption.spec.ts to test paths ending or containing "str" in WriteToFileTool and GenerateImageTool.
    • Verified paths remain unchanged and are processed correctly.
  • Misc:
    • removeClosingTag is retained for handlePartial methods only.

This description was created by Ellipsis for ca4a39d. You can customize this summary. It will automatically update as commits are pushed.

…eTool

- Remove incorrect removeClosingTag calls from execute methods
- removeClosingTag should only be used in handlePartial for streaming
- Fixes issue where paths ending with "str" were corrupted
- Add comprehensive tests for path handling

Fixes #9298
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 16, 2025 09:37
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Nov 16, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Nov 16, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The latest commit properly fixes the test failures by using getReadablePath to compute expected values, making the tests platform-independent. The PR correctly addresses the file path corruption bug and now has passing tests.

Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 16, 2025
@bozoweed
Copy link

@roomote appear that we get 2 fail, you have to review the currentpr and made more robust solution

@roomote
Copy link
Contributor Author

roomote bot commented Nov 16, 2025

Fixaroo Clock   See task on Roo Cloud

Fixed the Windows test failures by making path expectations platform-independent.

View commit | Revert commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

4 participants